package com.lanyun.redis.util;


import lombok.Getter;

import java.util.concurrent.TimeUnit;

/**
 * redis缓存Key
 *
 * @Author Jqcc
 * @Version 1.0
 * @Data 2025/3/11
 */
@Getter
public enum CacheKey {

    /**
     * 用户信息缓存key
     */
    USER_INFO("user:info", 60L, TimeUnit.MINUTES),

    /**
     * 权限缓存key
     */
    AUTH_PERMISSION("auth:permission", 60L, TimeUnit.MINUTES),

    /**
     * 角色缓存key
     */
    AUTH_ROLE("auth:role", 60L, TimeUnit.MINUTES),

    /**
     * App用户登录信息缓存key
     */
    APP_USER_ID("app:user:id", 30L, TimeUnit.DAYS);

    private String cachePrefix;

    private Long cacheTime;

    private TimeUnit cacheTimeUnit;

    CacheKey(String cachePrefix, Long cacheTime, TimeUnit cacheTimeUnit) {
        this.cachePrefix = cachePrefix;
        this.cacheTime = cacheTime;
        this.cacheTimeUnit = cacheTimeUnit;
    }

}
